//
// Created by xili on 2024/8/2 21:08.
// Go big or go home.
//
#include <vector>
#include <unordered_map>

using namespace std;


class Solution {
public:
    int returnToBoundaryCount(vector<int> &nums) {
        int n = nums.size();
        int ans = 0;
        int sum = 0;
        for (int i = 0; i < n; i++) {
            sum += nums[i];
            ans += sum == 0 ? 1 : 0;
        }
        return ans;
    }
};
